﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VB.BusinessLogic.Models;
using VB.BusinessLogic.Services;
using VBBlog.Models;

namespace VBBlog.Controllers
{
    public class ArticleController : Controller
    {
        //
        // GET: /Article/

        public ActionResult Index(String alias)
        {
            Article article = ArticleService.Istance.GetArticleByAlias(alias);
            if (article == null) throw new HttpException(404, "HTTP/1.1 404 Article Not Found");

            ArticleViewModel model = new ArticleViewModel() { Article = article };
            return View(model);
        }

    }
}
